package utils

import (
	"cangqiong-takeout/src/common"
	"github.com/gin-gonic/gin"
	"net/http"
)

func ResponseSuccess(c *gin.Context, msg string, data interface{}) {
	c.JSON(http.StatusOK, gin.H{
		"code": common.ResponseSuccess,
		"msg":  msg,
		"data": data,
	})
}
func ResponseBad(c *gin.Context, msg string, data interface{}) {
	c.JSON(http.StatusOK, gin.H{
		"code": common.ResponseBad,
		"msg":  msg,
		"data": data,
	})
}
func ResponseError(c *gin.Context, msg string, data interface{}) {
	c.JSON(http.StatusOK, gin.H{
		"code": common.ResponseError,
		"msg":  msg,
		"data": data,
	})
}
func ResponseInfo(c *gin.Context, statusCode int, responseCode int, msg string, data interface{}) {
	c.JSON(statusCode, gin.H{
		"code": responseCode,
		"msg":  msg,
		"data": data,
	})
}
